<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<div id="app">
  <cpn>
    <!--    获取子组件中的pLanguage-->
    <template slot-scope="slot2" slot="first">
      <span>{{slot2.abc.join('-')}}</span>
    </template>
    <template slot-scope="slot3" slot="second">
      <span>{{slot3.abcd}}</span>
    </template>
  </cpn>
</div>
<template id="cpn">
  <div>
    <slot :abc="pLanguages" name="first">
      <ul>
        <li v-for="item in pLanguages">{{item}}</li>
      </ul>
    </slot>
    <slot name="second" :abcd="info">
      <h2>第二个具名插槽</h2>
    </slot>
  </div>
</template>
<script src="../vue.js"></script>
<script>
  const app = new Vue({
    el: '#app',
    data: {
      message: 'hello'
    },
    components: {
      cpn: {
        template: `#cpn`,
        data() {
          return {
            pLanguages: ['javascript', 'java', 'c'],
            info:'222'
          }
        },
      }
    }
  })
</script>
</body>
</html>
